package com.example.chat.pojo.bo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 好友实体
 * </p>
 *
 * @author 林邵晨
 * @since 2023-07-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "tb_friend",autoResultMap = true)
public class Friend extends Model<Friend> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户id")
    private String userId;

    @ApiModelProperty("好友id")
    private String friendId;

    @ApiModelProperty("好友状态：默认0，拉黑1，星标好友2")
    private Integer state;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @ApiModelProperty("添加日期")
    private Date date;

    @ApiModelProperty("聊天类型：默认0，聊天1，置顶2，删除 0")
    private Integer chatType;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @ApiModelProperty("聊天日期")
    private Date chatDate;

    @ApiModelProperty("会话最新消息")
    private String latestMessage;

    @ApiModelProperty("逻辑删除：0 未删除, 1 删除")
    private Integer deleted;
}
